Ext.namespace('VAS');
/**
 * 审核步骤表单窗口
 * @param {} config
 */
VAS.AuditStepsForm = function(config) {
	var _this = this;
	_this.config = config;
	VAS.AuditStepsForm.superclass.constructor.call(_this, config);
};
Ext.extend(VAS.AuditStepsForm, Ext.form.FormPanel, {
	initComponent : function() {
		var _this = this;
		var typeSelect = new Ext.form.ComboBox({
			store: new Ext.data.Store({
				proxy: new Ext.data.HttpProxy({url:'admin/audit/auditStep!getAllType.action'}),
				reader: new Ext.data.JsonReader(
					{root:'data'},
					[
						{name: 'typeCode'},
						{name: 'typeName'}
					]
				)
			}),
	        fieldLabel : '类型',
			name:'typeSelect',
			id:'typeSelect',
			mode: 'remote',
			width:120,
			triggerAction: 'all',
			valueField: 'typeCode',
			displayField: 'typeName'
		}); 
		
		var stepSelect = new Ext.form.ComboBox({
			store: new Ext.data.Store({
				proxy: new Ext.data.HttpProxy({url:'admin/audit/auditStep!getStepArray.action'}),
				reader: new Ext.data.JsonReader({
					root:'stepSelect'
					},
					[
						{name: 'value'},
						{name: 'text'}
					]
				)
			}),
	        fieldLabel : '审核步骤',
			name:'stepSelect',
			id:'stepSelect',
			mode: 'remote',
			width:120,
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text'
		}); 

		var config = {
			width:"100%", 	
			height : 47,
			align     : 'left',
			labelAlign:"left",
			labelWidth : 70,
			frame : true,
			border : false,
			layout:"column",
			items:[
					{
						cls : 'query-align',
						columnWidth : .27,
						layout : 'form',
						border : false,
						items : typeSelect		
					},{
						cls : 'query-align',
						columnWidth : .27,
						layout : 'form',
						border : false,
						items : stepSelect	
					}
				]
		};	
		Ext.apply(this, config);
		Ext.apply(this.initialConfig, config);
		VAS.AuditStepsForm.superclass.initComponent.apply(this, arguments);
	}
});

VAS.AuditStepsFormWindow = function($config) {
	var _this = this;
		var form = new VAS.AuditStepsForm();
		var thisConfig = {
				width : "100%" ,
				items :	[form]
			};
		var _config = $config || {};
		Ext.apply(this, Ext.apply(thisConfig, _config));
	VAS.AuditStepsFormWindow.superclass.constructor.call(this);
};
Ext.extend(VAS.AuditStepsFormWindow,VAS.BasicWindow,{
	initComponent : function() {
		VAS.AuditStepsFormWindow.superclass.initComponent.call(this);
	}
});

Ext.reg('auditStepsForm-win',VAS.AuditStepsFormWindow);

